package com.dm.flyweight.demo01;

/**
 * 享元工厂
 * @author Administrator
 *
 */
public class FlyweightFactory {

	public static OwnCharacter createCharacter(String alph){
		//此处也可以初始化26个对象，返回不同的对象
		OwnCharacter character = OwnCharacter.getInstance();
		switch (alph) {
		case "a":
			character.alph = "a";
			break;
		case "b":
			character.alph = "b";
			break;
		//---------其他--------------
		default:
			break;
		}
		return character;
	}

	public static OwnRow createRow(){
		return new OwnRow();
	}
	
	public static OwnColumn createColumn(){
		return new OwnColumn();
	}
	
}
